<div class="panel panel-default">
   <div class="panel-heading">
    <h4 class="panel-title">
     <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#product">
         <i class="icon-angle-down bigger-110" data-icon-hide="icon-angle-down" data-icon-show="icon-angle-right"></i>
         &nbsp;商品
       </a>
    </h4>
   </div>
   <div class="panel-collapse collapse in" id="product">
     <div class="panel-body">


<div class="row" style="margin-bottom: 5px;">
  <div class="col-md-12 center">
    <span class="profile-picture">
      <img id="show-gift-add-product" class="editable img-responsive" src="{urlStatic('images/picture_add.jpg')}" style="max-height: 130px;" />
    </span>

  </div>
</div>

<div class="row">
  <div class="col-md-12">

<form class="form-horizontal" role="form" id="gift-add-product-form" method="POST">
  <input class="hidden" name="image" id="gift-add-product-image" >
  <input class="hidden" name="type" value="product" >
  <div class="form-group">
    <label class="col-sm-2 control-label no-padding-right"> 消耗鲜花 </label>
    <div class="col-sm-10">
      <input type="text" name="flowers" class="input-mini" vaule="" id="flowers" />
      (朵)
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-2 control-label no-padding-right"> 礼品数量 </label>
    <div class="col-sm-10">
      <input type="text" name="amount" class="input-mini" vaule="" id="amount" />
      (朵)
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-2 control-label no-padding-right"> 上架 </label>
    <div class="col-sm-10">
      <input class="ace ace-switch ace-switch-7" value='1' name="status" type="checkbox" />
      <span class="lbl"></span>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-2 control-label no-padding-right">礼品名称</label>
    <div class="col-sm-9">
      <div class="input-group">
        <input type="text" class="form-control" name="name" value="">
        <span class="input-group-btn">
          <button type="submit" class="btn btn-info btn-sm">添加</button>
        </span>
      </div>
    </div>
  </div>
</form>

  </div>
</div>

     </div>
   </div>
   {include file='admin/upload_image.phtml' showid="show-gift-add-product" callbackid="gift-add-product-image" btnchoose="上传礼品图片" type="gift"}

   <script>
    $('#flowers').ace_spinner({ value:0, min:0 ,step:1, max: 100000, on_sides: true, icon_up:'icon-plus smaller-75', icon_down:'icon-minus smaller-75', btn_up_class:'btn-success' , btn_down_class:'btn-danger' });
    $('#amount').ace_spinner({ value:0, min:0 ,step:100, max: 100000, on_sides: true, icon_up:'icon-plus smaller-75', icon_down:'icon-minus smaller-75', btn_up_class:'btn-success' , btn_down_class:'btn-danger' });
    $('#gift-add-product-form').submit(function(e) {
      var _this = $(this);
      _this.attr('disabled', 'disabled');
      var data = LIVE.component.form.getData($(this));
      var flowers = parseInt('0' + data['flowers']), amount =  parseInt('0' + data['amount']);
      if (!data['image']) { return alert('请上传礼品图片') || e.preventDefault();}
      if (!flowers) { return alert('请填写消耗鲜花') || e.preventDefault();}
      if (!amount) { return alert('请填写礼品数量') || e.preventDefault();}
      if (!data['name']) { return alert('请填写礼品名称') || e.preventDefault();}

      return true;
    });
   </script>
  </div>


